
package com.elite.groovy.callback
import com.elite.groovy.kh.DHAESUtil

import com.elite.groovy.util.Util
import com.elite.groovy.kh.getProperty
import com.elite.groovy.util.EliteBean
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory

import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

/**
 * @author ThinkPad
 *
 */
class aesutilEncrypt implements ServiceBackInvoke {
    private static final Log log=LogFactory.getLog(aesutilEncrypt.class);

    String doCallBack(EliteBean eliteBean, HttpServletRequest request, HttpServletResponse response) {

        def body1= Util.getRequestBody(request,"utf-8");
        log.debug("body1----------------:"+body1);
        // def str1 = URLDecoder.decode(body1, "utf-8");

        def assertKey = getProperty.get("ZhanYeAESPassword")
        def aesmi2=DHAESUtil.encrypt(body1,assertKey);

        log.debug("加密后的数据22222是："+aesmi2);

        return aesmi2;
    }


}
